/*
 * @title: babel配置文件
 * @author: andy.ten@tom.com & xukaixing@hotmail.com
 * @Date: 2022-03-16 08:17:13
 * @LastEditors: andy.ten@tom.com
 * @LastEditTime: 2022-04-14 11:51:09
 * @version: 1.0.3
 * @copyright: copyright (c) 2022 andyten
 *  node: you can not copy and/or use and/or modify this program free,
 *  please reserve the segment above.Please mail me if you have any question.
 */

// 转换jsx语法 需要npm
const plugins = [
  'jsx-v-model',
  'jsx-event-modifiers',
  '@vue/babel-plugin-transform-vue-jsx',
  [
    'component',
    {
      'libraryName': 'element-ui',
      'styleLibraryName': '~node_modules/element-ui/packages/theme-chalk/src',
      'ext': '.scss'
      //
    }
  ]
];
// 生产环境移除console
if (process.env.NODE_ENV === 'production')
  plugins.push('transform-remove-console');

module.exports = {
  presets: [
    '@vue/app'
  ],
  plugins: plugins,
  env: {
    development: {
      plugins: ['dynamic-import-node']
    }
  }
};
